Skip to content

fix(server): Antigravity's Gemini 4 Hydrogen (High) usage is no longer unpriced - #40901

Open
kristianbonnici wants to merge 3 commits into
pingdotgg:mainfrom
kristianbonnici:fix/antigravity-stacked-effort-suffix
Open

kristianbonnici wants to merge 3 commits into
pingdotgg:mainfrom
kristianbonnici:fix/antigravity-stacked-effort-suffix

Conversation

@kristianbonnici

Copy link
Copy Markdown

Problem

Antigravity records Gemini 4 Hydrogen (High) as gemini-4-hydrogen-tiered-high. Usage prices an effort or routing variant at its base model's rate by stripping the suffix, but it stripped only the last one: this name looked up gemini-4-hydrogen-tiered, found no rate, and showed as Unpriced, adding $0 to the estimated cost. Its tokens were counted; only the cost was missing.

Change

antigravityRateModel strips stacked effort and routing suffixes one at a time and checks the known aliases after each step, so gemini-4-hydrogen-tiered-high prices at the gemini-4-hydrogen rate and an alias keeps its rate under a suffix (gemini-3-flash-agent-high prices as gemini-3.5-flash, not gemini-3-flash-preview). Names that priced before, the model name Usage shows and the token totals stay as they were.

Scope

A small fix for an obvious bug, so no issue. Open PR #39852 edits the same suffix pattern (it adds -xhigh and -extra-high); whichever merges second needs a one-line rebase.

Verification

  • Extended the existing test prices ACP effort variants at the base model rate with gemini-4-hydrogen-tiered-high and gemini-3-flash-agent-high, and a price check for the Hydrogen record. On main the new rows map to gemini-4-hydrogen-tiered and gemini-3-flash-agent and the record is unpriced; with the fix the test passes.
  • Ran the real readAntigravityUsage and priceUsage on main and on this branch over snapshots of my own Antigravity conversation databases. The only difference: 29 calls (0.42M tokens) recorded as gemini-4-hydrogen-tiered-high were Unpriced on main and price at the gemini-4-hydrogen rate here. No other model's records or prices changed.
  • The suffixes are stripped in a loop, not by recursion: a malformed name with 100,000 stacked suffixes resolves in about 5 ms.
  • vp run check:changed: format, lint, knip, graphql, typecheck and tests pass.

Created with Claude Opus 5.5 in Claude Code, running in T3 Code. Reviewed by GPT-6.2 Sol in Codex, Claude Opus 5.5 in Claude Code, Orchestrator (Neon) in Antigravity and DeepSeek V4.1 Flash in OpenCode.

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 22, 2026
@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Antigravity usage reader now resolves stacked model variant suffixes iteratively and applies aliases during resolution. Tests cover Hydrogen tiered-high and Flash agent-high mappings, including Hydrogen tiered-high pricing.

Changes: Antigravity rate resolution

Layer / File(s) Summary
Variant resolution and pricing tests
apps/server/src/provider/Drivers/antigravityUsageReader.ts, apps/server/src/provider/Drivers/antigravityUsageReader.test.ts
The reader repeatedly removes recognized suffixes and checks aliases after each removal. Tests verify the Hydrogen tiered-high and Flash agent-high rate mappings, and assert a Hydrogen tiered-high cost of 19e-6.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Suggested labels: bugfix

Suggested reviewers: juliusmarminge, marcodotio

Merge Risk: Minimal · up to fd345

This change prices Antigravity usage for stacked model suffixes such as gemini-4-hydrogen-tiered-high, which previously contributed $0 to estimated cost. Tests cover the new mappings and the Hydrogen price. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: Antigravity's Gemini 4 Hydrogen (High) usage was unpriced and is now priced. It matches the changeset, which strips stacked variant suffixes so that gemini-4-hydrogen-…
Description check Passed The description follows the template. It has Problem, Change, Scope, and Verification sections, and each is filled in with specific content. The Problem section states the expected behavior and the bu…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: Antigravity's Gemini 4 Hydrogen (High) usage was unpriced and is now priced. It matches the changeset, which strips stacked variant suffixes so that gemini-4-hydrogen-tiered-high resolves to the gemini-4-hydrogen rate. The title follows conventional commit form and is specific enough for a teammate scanning history.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope, and Verification sections, and each is filled in with specific content. The Problem section states the expected behavior and the bug. The Change section explains the iterative suffix stripping and alias handling. The Scope section explains why no issue is linked and notes the related open PR. The Verification section lists the extended test, the snapshot comparison with observed results, the loop-performance check, and the repo check run. The template's agent attribution line is present at the end. The Scope section does not link an issue, but it gives the reason for having none, which the template allows for small obvious fixes.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1d02824 and fd3456e.

Files selected for processing: 2

  • apps/server/src/provider/Drivers/antigravityUsageReader.test.ts
  • apps/server/src/provider/Drivers/antigravityUsageReader.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant